home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Disc to the Future 2
/
Disc to the Future Part II Programmer's Reference (Wayzata Technology)(6013)(1992).bin
/
MAC
/
THINKC
/
4_0
/
VIVIDUS
/
VECT.SIT
/
vect
/
vect.h
< prev
Wrap
C/C++ Source or Header
|
1991-09-25
|
3KB
|
89 lines
#pragma once
/* ======================================================================
This header file is Copyright 1991 by Vividus Consulting.
This is not public domain source code. You may not copy and
paste from this source code. Read your Vividus Licensing
agreement for details and other restrictions.
This header file is for anything that uses the vect Vividus
Source Code Library.
====================================================================== */
#ifndef PI
#define PI 3.141592653589793238
#endif PI
#define _vect_
typedef double velem;
typedef struct {
velem x,y,z;
} vector; /* a whole vector */
typedef struct CoordSys{
vector xAxis, yAxis, zAxis;
} CoordSys;
typedef struct {
int x, y, z;
} IntVector;
typedef struct {
Fixed x, y, z;
} FixedVector;
void vunit(vector *v, vector *vo);
void vcopy(vector *v, vector *vo);
void vscale(velem scalar, vector *v, vector *vo);
void vsub(vector *a, vector *b, vector *v);
void vvect(vector *a, vector *b, vector *v);
void vadd(vector *a, vector *b, vector *v);
void vsadd(vector *b, velem m, vector *x, vector *v);
void vcross(vector *a, vector *b, vector *v);
velem vdot(vector *a, vector *b);
velem vmag(vector *v);
velem vdist(vector *a, vector *b);
velem vangle(vector *a, vector *b);
void vmul(vector *a, vector *b, vector *v);
void vsphere2v(double rho, double phi, double theta, vector *v);
void vv2sphere(vector *v, double *rho, double *phi, double *theta);
void vnorm(vector x[], vector *norm);
void vmatmul(vector *a, vector m[], vector *v);
void vcmin(vector *a, vector *b, vector *out);
void vcmax(vector *a, vector *b, vector *out);
Boolean vvalid(vector *v);
void vCopy(int n, vector x[], vector xn[]);
void vTranslate(int n, vector x[], vector *b, vector xn[]);
void vScale(int n, vector x[], vector *s, vector xn[]);
void vRotate(int n, vector x[], vector *o, vector *norm, velem angle, vector xn[]);
void vRotate3(int n, vector x[], vector *a, vector *b, vector *c, vector xn[]);
void v2fv(vector *v, FixedVector *fv);
void fv2v(FixedVector *fv, vector *v);
void fv2iv(FixedVector *fv, IntVector *iv);
void iv2fv(IntVector *iv, FixedVector *fv);
void fvcopy(FixedVector *v, FixedVector *vo);
void fvscale(Fixed scalar, FixedVector *v, FixedVector *vo);
void fvvect(FixedVector *a, FixedVector *b, FixedVector *v);
void fvsub(FixedVector *a, FixedVector *b, FixedVector *v);
void fvadd(FixedVector *a, FixedVector *b, FixedVector *v);
void ivcopy(IntVector *v, IntVector *vo);
void ivscale(int scalar, IntVector *v, IntVector *vo);
void ivvect(IntVector *a, IntVector *b, IntVector *v);
void ivsub(IntVector *a, IntVector *b, IntVector *v);
void ivadd(IntVector *a, IntVector *b, IntVector *v);